code cleaning. fixes