Unified similar code for loading features