refactor the locals a tad