refactorizando rails best practices