Remove unused definitions and reformat