view as enum

View now makes use of a enum instead of a int.

This gives good type safety, as well as simplify making view obsolete.