updated utility functions to read directories too. minor adjustments to rule readers.