Implement `to` function for composite and cleanup