Cleanup the deprecation code a bit