Styles the flash messages and refactored the flash message code