use member function pointer to replace duplicated code.
fix some bug in the instance.