Refactored to PIMPL pattern