createSlot function in Factory class