Finish refactoring

Change-Id: Ie7e128a07ece1f5a79694fdbc3f3a756806fcee1