further removal of dead code, general cleaning and grokings