Removed useless code and applied javadoc style