Changed type() to enum