refactor resources module