update code to comply with rubocop