Further refactoring of decl' to allow errors to be propagated
correctly