Cleaned up address handling, making more code common