Refactor render span