memory optimization | only load files when needed