Changing repetitive code to a micro-DSL approach to reduce library size. Just a PoC; has bugs; will break build.