MODE-1920: Clean up code and java-doc