Add extra argument for external methods.

All internal methods for retrieving the needed information use the
passed variable. It should be available for external methods as well.