Code Rearranged

Removed many used import
Code restructureand remaining