Extract code for single and multi-file package builds into helper fns