refactoring
rendering in separate thread works