Consolidate code to retrieve elements used by plug-in.