Refactor module exceptions