refactor to not use a filter