Refactor for ruby style