refactoring
add some javadoc