Replaces switch statement (99.8% coverage)