converted flat interfaces to pimpl pattern