switching controller logic in model