cleanup and updated javadoc