Removed unused modules & moved var declarations