legacy subfunction