moved file loading method into model