Removed state management and smart ptrs