legacy stuff cleanup and runtime issue fixes