Refactor previous change into reusable function and reuse in appropriate places.
Refactor previous change into reusable function and reuse in appropriate places.

taskforcedev/crud-api,taskforcedev/crud-api