- Generify compile method
- Improve error handling