more static functions, improved test suite