Use InputStream instead of files