test file search utility and some code cleanup