use ProfileRegistry in HalService
fixes bug
refactoring
fixes a bug
refactoring and improved testing
error handling
refactoring
handles embedded resource