Moved model related code into an object called 'resolver'.