refactor trains page