Reorganizes code and track hostnames in UA