[WIP] Codegen errors

- [x] Remove duplication of interfaces
- [x] Fix fatal errors
`array_map` requires more memory and is slower AFAIK