refactored PDO to construct db object based on passed arguments instead of constants