[WIP] Codegen errors

- [x] Remove duplication of interfaces
- [x] Fix fatal errors
Please `array_map` here