modified to have better support of maas 2.0