use switch to handle different configtypes.

Not sure how I feel about this stype in attributes


cc @asher