Reworked, now doesn't abuse lambdas