Made stupid if-else into smart case