all sorts of changes and cleanup