WIP - enums
WIP - big refactor to reduce code duplication and to parse unions