generate_filter helper function
Better 'get' function