Moving filter and function arrays into method