a few more function signatures
some more funcs and tests refactored