Add the @rule decorator and fix the structure for tests