format fixes and flow