moved autoscaler to lib