Move logic out of view into collection