Update code based on review