cleanup up some output, and the filtering process