Refractoring and code cleanup
Refractoring and code cleanup