refactoring some more- common elim is currently broken