update with better ruby style