Revert "code cleanup"

This reverts commit eb389e7718f86dc641b1339ad1ee990174ee3147.
Revert "Revert "code cleanup""

This reverts commit da86bcbb58d45448cc5f96f1abaae0341e9be9d9.