Code cleanup v2