Refactorizar codigo