Removing unused libraries and tidy up