Flexible modeling of the hazard rate and treatment effects in long-term survival studies