Auto structuring code