refactor load() code... it was horrible