cleanup factory class and tests