Refactoring of bytecode generation infrastructure