move class def to lib so we can test it