Move control logic to package.