split test code with main logic