Simplify the API

Changed three lines repeating in each member function
to a function call doing the same.