Consolidate logic.