Cleanup and refactor of filters