Extract database filtering into a class