Accept, add test and expect data, and clear up the logic