Add UT and make easier to build