restructure spiro test code