factoring some C#