resource manager refactor && test