chanege the context form if-else to switch