refactoring the night train