moving update logic into commander compatible script for use with chief