channels/rail: refactoring