Refactor: Tests and .rb for carriage and train