Some cleanup and javadocs