Make it compile again (inappropriate `where`)
Adjust type signatures and partial appliication of some functions