Refactor maxmind_local lookup