Updates to switch- handles name type conventions seperated helper function out.