Setting up UI and loading user preferences