Minor refactoring and enabling C++11