after algorithm for QA selection refactoring