Clean the main codes

Improve readability of the main integration code.
Clean the test codes

Clean the test codes for better readability