Refactoring
fixing some bugs with enum generation