helpful functions for composition