Revert "rewrite using c++ and application of new design"

This reverts commit d1508707ac3fde2a8eed53d0f870d589c81da0f1.

Change-Id: If44dcf4e823869d8e105b1c56ddec08acd7288ba