Refactoring del codigo