optimize build, support filter config. Fixes #603 #604
rebuild