Some more refactoring.  Still need to sort out build process