refactor the RBF training