add common util function: extend