code refactored, ui and uix