Some improvements on functions and collections