Added functionality to Settings UI
Another code refactor