refactor to cut in half