some cleanups using lambdacase