Switched to PDO database layer