Fix #6 Move logic from Model to Controller