move exceptions into separate module