Refactoring of ws tests