moved some internal stuff to its own package