refactor preparation to separate parsing from pyloadApi