restructure linear training