cleanup; fix & update tests