Better DNS zone and existing container checks - some additional code refactoring