Moved realtime code into its own controller