split logic and control