Refactoring middleware systems: A Case Study