sync'd improvements from development branch