replaced general func with a member func