refactor tests

self-contained, more go-like