moving render code to a frontend class