Yaweh didn't create those laws, they had already been in human society (even written down as law) for hundreds of years before Moses went up the mountain. The 10 Commandments is nothing special, except that it adds religious observance of the Jewish deity.
If as you say, those laws were around for a long time among humanity before they were handed to Moses on the Mountain, it doesn't prove they were not written by God and handed out to others at an earlier time.