Refactoring: Move function of set training into PLA, simplified the code