Ruby refactor.