Moved some functionality from Blueprint to C++ code