javadoc & some minor refactoring
minor refactoring