refactor lps, add spec