refactor and ruby style