Added Utility functions and tests