improve readability and remove deprecated code

Change-Id: I7bb20922a39e03dc524aa4253ff3bf08e9b71bec