Moved duplicated code due to warning from last commit in Codeclimate.