Refactoring Training model