Move errors to separate module