extracting code to a model method
Merge pull request #23 from SimonGreenhill/model-method

extracting code to a model method