cleaned load function