some improvements
tests for internal functions