reorganize and improve flash messages