improved the object oriented design
by placing moving common functions to abstract class
Placed the implementation details as private