- Handle exceptions properly
- remove unused code