Javadoc documentation and remove cluttered code