Refactor tup