Refactor document test