some substitution helper functions