organize martini handle into function