Refactor to use input/output pattern instead of extract/load.