Refactored the classes to remove un-used duplicate code.