several changes to make filtering possible