separate out each rule set a bit more and make the library->sample merging optional [ci skip]