Simplifying a few lines of code using C++11's 'auto' and '>>' support.