Clean up variable names and javadoc