Refactor test into a model.