Revert "Revert "Revert "refactoring"""

This reverts commit ac108b6f5af150e17593b4563f6a137426520489.