add _messages partial file and refactor flash message