refactored moraic analysis