Restructured switch statement

Made the switch statements a little better and added a semi data
dictionary, touches now seg fault.. Not sure why at all as I never
modified the relevant classes