Utility functions moved to helper class.