Remove redundant temporary variables