Refactoring monitoring and logging