fixed oddness in enum declarations, refactored pointer stripping into it's own function