template expansion, file copy working. lots of mess remains.