cleaning up logic in get_addresses.hs