clean if-else in home page