moving custom resources logic to resources factory