Refactoring around color filtering