How might you make this more efficient?