pull average logic out of controller into item model