Revert "code cleanup"

This reverts commit 4840dd30c1dc4ad883c8123dc61eb69569d71463.
Revert "Revert "code cleanup""

This reverts commit c3d6ac674b72b2a5cb5320257aac8361a75cd7b2.