clean ws code + singleton implem