add per-file logging and other things
refactor to pull things into hypothetical external repositories