Switing and to && + other style improvements