Better render and state handling