Code clean up and minor changes whilst working on integration with AS8 domain management.