use toString not name; simplify switch statements