move code from lm-test into its own class