Cleaning up some glue code