code simplification and javadoc