Some refactoring

-C++11 features added
-OOP improved
-No function changes