Made function composition more efficient