minor changes and tidying up the classes structure, etc - also migration to c++11