moved generic stuff to a separate library