Factoring and canceling out terms