Use enums where possible

Linked to #998 
Here is a working version of the enums addition, 100% identation mess free (I think so, it should be correct).

(PS: first time doing such work in open projects, sorry for my incomptence with some things.)