Remove direct call to spark API