Fix filters and code cleanup