use source filter macros to reduce code duplication