Improved first option, refactoring, added proper messages.