Refactor setup into model and slim controller.