slight improvement in semantics, consts and usage of wstrings instead of wchar_t