What about extracting this to a Model function and add a test?