Soem more utility functions and tests