Refactored to become more object oriented so that it's easier to use more than old filter