simplify code and represent tests with hex values