Add helper functions and mappings