Long-overdue refactoring/abstraction of rendering code.