Put render code in several functions + add better timers + some refactor