Refactored DBConnect calls to macros