curl: put init and print code to where it belongs