Refactoring bugfixes

Change-Id: I2be1406ada25c3df778386621383db2b0ebdba8f
Signed-off-by: Martika <Martika@MC2>