move exceptions into the constructor