Moral codes adjust themselves to environmental conditions.
I guess to me religion is a kind of moral code.