More refactoring and cleaning of code