refactor with the simplified testing