hidden function to simplify a very common pattern in js metamodel