Refactoring Bodin code.