code cleaning and function reshuffling among the modules.