refactor code for RullReview