standardize formatting, group declarations by scope