build load function