Create Nest model and remove logic from view, add tests.