if-else should be avoided