Refactor take-upto