improve controll structure