Switched to unique_ptr and shared_ptr internally to make the code a bit easier to maintain