I'd prefer having the method definition before you call them i.e. randomize_vdocs, _get_entry and prepare_sandbox before the call.