Moved library to Doctrine DBAL and simplified existing implementation