Code cleanup + improve global completion status