starting refactor
checkpoint
checkpoint
works, still need to move lambda
works, still need to move lambda
yay, works
refactor done