refactoring passenger and train