General cleanup - removing unecessary code, added docstrings, fixed obsolete ones, etc.