Dedup code in clean_address