view as enum

same as 0.5 pull request, except for 0.4 branch.