more code update based on review