C++11 and some refactoring