Refactored MachineFactory to machine.factory to eliminate cyclic dependencies