Monitoring and refactoring