Updated UI, refactored code