better use of locals