Refactoring STMTUI