refactored moment filter