Generalized the factory into it's own module

Now the inclusion is much easier and follows best practices