separated model swtch logic