Remove redundant code and improve accuracy

Change-Id: I00c6953a041b38c68b658377516a82e8aa9cdb6c
Merge "Remove redundant code and improve accuracy"