Text class implementation