Revert "Code Rewrite"

This reverts commit d7722b2f7890cc4769b85bf4c61aa3a0de9cdfaf.