mammoth refactoring