refactored loading references