Refactor logic components example