change code according reviewer suggesions