refactoring Logcat tool