Replaced shared_ptrs with typedefs and common pointers