Remove unnecessary code and applied javadoc