refactor main loop out of xtop_view completely (leave it only for rendering)