eliminate many var statements per function