Refactoring code with Mina