logging and javadoc
refactoring