refactoring in JavaByteCodeGenerator