Adding factory class.