Filter modification, code cleanup