Refactor test 5d