Move render logic to the correct view