Refactor how flash massages are shown