Revert "Code refactory"

This reverts commit 977d495c497c209d59f7e1f6af6fa1e1b88ad702.