refactored mutation and logging