Refacto to allow other protocols that files on disk