Refactored the classes to be more flexible by creating a base class for other classes to inherit.