various gd cleanups