inspired by lettuce, but be pythonic