small refactor

- [x] better error handling
- [ ] remove the need to resolve paths when reading files