Convert to use conditionals rather than a bunch of if/elses