Updated for use with the PDO class, according to PSR standards