Extracted dbwriter and scaner to files