Cleaned bits of code up and removed unneeded use statements