Extract some reflection magic so it can be used for something else than Routes