Refactoring. Improved code generation.