Code simplifying