refactoring lemma package