reduce nestings