Styled flashes and refactored code