More refactoring
Tests and refactoring