Added connect-flash and refactored to use flashService