refactored flash messages with help of application_helper.rb