genericize level logic