Extracting the getElement method into its own module for easy injection