Update code to comply with Rubocop, remove unecessary if statements