getting the common code to work across multiple plugins