Code Refactor and restart capability