Refactor code generation for built-in operators