refactoring of instance rendering