input filtering optimalization