Moved the rendering part of the VideoEngine run() function in a separate function