reorganize and improve related tests