fixes

added script for manage as capacity. extracted common functions