added option for applying settings on boot and did a little refactoring and cleanup