Code and inheritance tree cleanup