a little of refactoring and ruby s style