Restructuring and removing obsolete code
Restructured and improved