Cleanup and javadocs