Refactoring toolkit and adding UI support