Refactorized some unuseful code and files.
Fixed #7. Added get_linkage_rules function.