More javadoc, more refactor