break into two files, and support dirs as args