Revert "Refactoring"

This reverts commit 4d4052779d360769a08604134165090a916d5bcc.
Revert "Revert "Refactoring""

This reverts commit 80cb287afe552c3ae3dfde57dbba391480101795.