delete ui and code duplication