use better ruby method