MagicByte unit test
light refactoring