turn the glue code into a separate file as well