Moved query builders and DB factories

- namespace adjustments