simplify
fix some bugs around emptiness