Refactor a bit, add BottomUpEnumerator