Refactor resource is registered.