organizing code

Change-Id: I259266cdabbe65f2cc12d78912b3b8d5c5017559