Calculus of fractions and homotopy theory