Refactoring logic components