Add exclusions, refactor some code