Some refactoring, added one test