EG/HM: small refactorings