Removed unused code and added missing javadoc comments.