cfd:ws2:refactoring and cleanup