Cut elimination with applications