This was a best-effort attempt but it looks really clumsy, is very repetitive and makes code around it hard to read.