Code cleanup phase 5