Bug Fix: Application crashes on registering with empty host
Minor refactoring
Merge pull request #2 from vishrayne/master

Bug Fix: Application crashes on registering with empty host