Any possible to implement above functions in common instead of copy same code in each impl.