Simplification of control logic