Revert "Speed optimization"

This reverts commit 36e4cf8e200deb151b597c6cdc8c26749f9d53e2.