Moving factory into a package