Move flash message handling to service