formatting, region addition, removing extraneous if checks