Fixing some UI issues, refactoring