Some refactoring of the code.

Change-Id: I7b2aa13621c9a2e7a952efafbb1aaf4d86461fed
8 files changed