Refactor set test