misc: bring bagyusz changes with some modifications

Change-Id: Iafc262327fb0160920fea6b83ba100552cb26c91