Refactoring and show distance