Refactor ControlThread to break if statement.