It was copied from old client. I don't want to mix "dropping" old clients and changes in working code. As i plan to to some changes in following PR and this code works I decided only to move working code into lib.