Refactoring lambda to use const references. Because OCD.