Extract into common package.