Settings: Cleanups and improvements of code