Refactored rendering code a bit