Refactor rule packages