self-calling constructor as in http://habrahabr.ru/post/135027/