Exporting a function that accepts an element