Code cleanup, javadoc