Code review and improvements.