Revert "some refactorings"

This reverts commit 9f4cc1d8319e22dcb2fdc26f14a83bef9edb50ff.