Remove useless uses of cat, and replace with filename arguments