Refactors render