Move logic out of anon function