Factorise AZDO related code