make rendering more efficient. fixes #44