implemented wireIn, and refactored Factory