getting rid of enums and regex for JS compiling