Some helper functions added