Enhancing modularity of simulation software through modern C++ features on the example of GADGET