separating controller and model better