Consolidated common code, removed uneeded classes