Style editing

Put loop in a separate method to keep function lengths short