refactor and reorder tests into more logical arrangement.