decouple entityResource from the function call