cleaning up document stuff