Refactored and documented homemap