updating to use the passed in instance of assemble instead of requiring a global instance