implements the entity macro, but please note the fixme!