Refactores code