some code cleaning and renaming