Refactored names, corrected possible cycles in using shared_ptr