name refactors, and made commandbag handled with shared_ptr