Updates code for use as an extension