Flash messages. Controller refactoring