refactor registry