[FOLD] Re-order assignment of smart pointers and const modifiers