make formatting less brittle, don't depend on entity type