some more changes and cleanup