Refactoring to reduce Code Metrics