refactored and loaded from previous repo