Arrange the logic.