Add lambda interface, refactor tests