Some refactoring to provide types and exceptions as helpers to other plugins