removing redundant code and adding a jar with all the common code