factored model out of view controller