Refactor so that Pipeline only deals with data, and not a file path