Refactoring, and fixed ui spelling error