removed model logic from controller