Refactoring rendering thread behaviour