extracted out ws module