Refactor out temporary local variables