refactor unit test; optimize imports