Ensure rendering and state is handled in the correct places