Refactored rendering and collision codebase