refactored out registry