Updated helper functions to make them more generic. Their names are changed, but old names are still supported (although deprecated as of now).