Refactored for flash messages closes #8