More refactoring and clean ups