Ugly Typescript Code, can it be improved? It works, it just doesn't feel like the best way - Theo's Typesafe Cult