refactor tests to use Go method