In fact, your solution please me a lot because I understand it and it seams natural to me 
But, I see an opportunity to learn something with the raildex way ^^
I think I will implement the two :
Yours for the final result and the one from Raildex to learn about interface.
I feel this is important 