Small refactor to tests