split gen functions + fixed filter condition