optimize calling of function by using of member function