partial fix of yan's review comments
more feedback from yan