Some refactor, UI changes and best practice