add switch and fix style