Decouple rails (fixes #23)