simplified configure logic into switch statement
autojunk'd