small improvements, cleaned up filtering