refactor watcher, generator, tpldata into their own file