Add unit test for factors