Split render code into 4 files