Revert "Code optimalization"

This reverts commit 458e7fd50c9b0dc11437397f84be6c55b0ee657e.