Code cleanup based on review