refactor session flash message