migrating prep.cmd -> prep()