Refactor code using reek gem