some refactor of resource registry