Refactored out common code into an abstract class.  Removed unnecesarry code and dependencies