A more robust function import