break some docker interactions to functions