Moved a few render functions to free functions