Setting offset depending on entity type