Fragments: Use switch statements over if else statements for legibility and neatness

Updated README too