xGot unittests working again, cleanup and complexity reduction