rules ui refactoring + some fixes