Improved code generation Javadoc and refactored a bit.