Incorporated the rest of the advise from @haojun review. Many thanks @haojungit diff