Improvements

Even if the whole thing works well, I received a piece of advice from a confirmed C++ developer and modified some little things.