Fixing some of the refactoring issues

Change-Id: Ia459c6b3a2312c14c28bc77452550957bbcb7534