replace redundant functions