replace redundant grep file code with a generic grep file method...