flash notices refactor