Move glue functions into one file