generalizing subs for all cases