nonfunctional code: example of moving more code out of the controller