general code and comments clean-up