Finally getting rid of debug if-else.