Started refactoring

Change-Id: I0e7a5c851f16ed9ed85a27aef12f384543648bdb