Refactoring and Formalizing