Refactor to avoid explicitly listing all the different flavours of redeclarable
declarations, and duplicating code between them.