Improved markup and a bit of refactoring to check for the presence of plugin functions.