I'm not a huge fan of having a series of if-else blocks. Is there someway we can make this a little bit more composable?