Refactoring and adding separate page for training and predictions