[WIP] Codegen errors

- [x] Remove duplication of interfaces
- [x] Fix fatal errors
@staabm I would care about performance only after codegen. Codegen is not supposed to happen in production environments anyway.