more modifications and refinements