some refactorings & junits