Refactor conditions into selection.