Change if-else to switch-case
removed bins