Refactored partially (pimpl).