Refactor render mechanism (virtual-dom)