refact loads_function import code