Refactored memory management off pool onto shared_ptr