Make flow stats view reusable and in its separate source file.