cleanups of some code and beginning work on basefiles