Avoid lambdas for now to avoid clang 3.1 segfaults