#22949 remake. Code incapsulation