refactoring, javadoc, tests