Refactors local variables into constants.