Bug 2531

https://gist.github.com/artpard/5c24d26bbd252dee9aad
For training please separate lines 97-140 to mixin and use it in other methods