passing serverThreadTests with some utils and refactoring