refactor for c++14
more fixes