refactor for resources module