Adding factory definition