fix wrong empty check
rewrite functions for host and base domain of URI
make constant for UI setting and internal data
minor fix

* update comments