moved render code into module