Revert "clean up code"

This reverts commit 1bc86d1e69d481074a4400637bd6a1e91b581e65.
Revert "Revert "clean up code""

This reverts commit b99632be9b630c713efeb545f8929ce77acabfdd.