Threw out unused, obsolete classes and fixed the bug in taskfactory