This should really be broken onto multiple lines since it's several calls with context changes.