More refactoring
Working test, more refactoring