reorganize lr spec
rework memoization