restore to old code to remove redundant function