+ tests, minor refactor

Change-Id: I3485beae37c29284f0fe05e4cd114044951ff5ac