Cleanups

Some cleanups on code.

1. removed factories.py file. I tried a grep but find nowhere using it and the tests passed, so it's not been used currently right?

2. fixed a bug that every nosetests run will generate an useless html file.