Collection and scalar function enhancements and refactors