Use enums instead of values

In the previous commit I used direct values in the code, which is obviously wrong.