refactor glitch and filter