using restpal.pattern(), save a lot code.