Basic controller logic.