Small code refactoring.
Some more refactoring. Minor changes in UI,