more cleanup, use enums instead of defines