UI framework refinement with unit test

UI framework refinement with unit test