minor cleanup + propagate sleep parameter