apply template design pattern
unit test for domain classifier