style changes and removed switch case