Improve error handling
Refactor code and add icons