Factor out puget code into separate library.