improved/simplified logic for looking up the paths to entity models