Awful if-else removed using dynamic binding