More refactoring and adding