Refactor tests

Change-Id: I0fda52d61e72712d8dd3bc0c3b80ad0e864a4322