separate training and test mode