Create `$Host` and some code cleanup