#71 Updated to send HEAD request first to check for updates + other refactoring