Added FactoryInterface, renamed Factory to ClassFactory and updated the tests accordingly