Refactor the scene render in one single loop