fix reflection logic. was way too complicated