Refactor: rules (#18) * chore: add factory field to rule type * refactor: add rule factory architecture * test: modify variable test codes * refactor: apply factory architecture to mention * refactor: apply `factory` architecture to whole nodes * refactor: remove not required asserts * refactor: remove unused imports