devide logic into two controllers