Removes unnecessary resources, adds in more code for handling switch