Refactored mark_active