Move pairs object logic to one class.