refactorings, still no automated tests :(