SetExecuted in UI and refactoring

SetExecuted function implemented and refactoring