improved the Factory