Moving sub functions around