add WorkerFactory / DBMgrFactory

refactoring writeFileToDB() 

general modification (method names, variable names)