Move render to seperate file