latest changes and cleanup