Implemented staged build with code generation