refactoring clang

- dedup code
- flake8 for files that still used `# flake: noqa`
- pylint -E for things related to clang